/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.hotel.test.model.impl;

import com.hotel.test.model.Hotel;

import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.CacheModel;

import java.io.Serializable;

import java.util.Date;

/**
 * The cache model class for representing Hotel in entity cache.
 *
 * @author Vien-IT
 * @see Hotel
 * @generated
 */
public class HotelCacheModel implements CacheModel<Hotel>, Serializable {
	@Override
	public String toString() {
		StringBundler sb = new StringBundler(27);

		sb.append("{hotelId=");
		sb.append(hotelId);
		sb.append(", userId=");
		sb.append(userId);
		sb.append(", userName=");
		sb.append(userName);
		sb.append(", createDate=");
		sb.append(createDate);
		sb.append(", modifiedDate=");
		sb.append(modifiedDate);
		sb.append(", localId=");
		sb.append(localId);
		sb.append(", hotelName=");
		sb.append(hotelName);
		sb.append(", quality=");
		sb.append(quality);
		sb.append(", introduce=");
		sb.append(introduce);
		sb.append(", image=");
		sb.append(image);
		sb.append(", address=");
		sb.append(address);
		sb.append(", email=");
		sb.append(email);
		sb.append(", phone=");
		sb.append(phone);
		sb.append("}");

		return sb.toString();
	}

	public Hotel toEntityModel() {
		HotelImpl hotelImpl = new HotelImpl();

		hotelImpl.setHotelId(hotelId);
		hotelImpl.setUserId(userId);

		if (userName == null) {
			hotelImpl.setUserName(StringPool.BLANK);
		}
		else {
			hotelImpl.setUserName(userName);
		}

		if (createDate == Long.MIN_VALUE) {
			hotelImpl.setCreateDate(null);
		}
		else {
			hotelImpl.setCreateDate(new Date(createDate));
		}

		if (modifiedDate == Long.MIN_VALUE) {
			hotelImpl.setModifiedDate(null);
		}
		else {
			hotelImpl.setModifiedDate(new Date(modifiedDate));
		}

		hotelImpl.setLocalId(localId);

		if (hotelName == null) {
			hotelImpl.setHotelName(StringPool.BLANK);
		}
		else {
			hotelImpl.setHotelName(hotelName);
		}

		if (quality == null) {
			hotelImpl.setQuality(StringPool.BLANK);
		}
		else {
			hotelImpl.setQuality(quality);
		}

		if (introduce == null) {
			hotelImpl.setIntroduce(StringPool.BLANK);
		}
		else {
			hotelImpl.setIntroduce(introduce);
		}

		if (image == null) {
			hotelImpl.setImage(StringPool.BLANK);
		}
		else {
			hotelImpl.setImage(image);
		}

		if (address == null) {
			hotelImpl.setAddress(StringPool.BLANK);
		}
		else {
			hotelImpl.setAddress(address);
		}

		if (email == null) {
			hotelImpl.setEmail(StringPool.BLANK);
		}
		else {
			hotelImpl.setEmail(email);
		}

		if (phone == null) {
			hotelImpl.setPhone(StringPool.BLANK);
		}
		else {
			hotelImpl.setPhone(phone);
		}

		hotelImpl.resetOriginalValues();

		return hotelImpl;
	}

	public long hotelId;
	public long userId;
	public String userName;
	public long createDate;
	public long modifiedDate;
	public long localId;
	public String hotelName;
	public String quality;
	public String introduce;
	public String image;
	public String address;
	public String email;
	public String phone;
}